{% extends "./inc/base.html" %}
{% block style %}
<!--<link rel="stylesheet" href="/static/js/slider/slider.css" type="text/css" />-->
<link rel="stylesheet" href="/static/admin/js/chosen/chosen.css" type="text/css" />
<script src="/static/admin/js/jquery.min.js"></script>
{% endblock %}
{% block content %}
<section class="vbox">
    <header class="header bg-light dk">
        <p>{{controller.meta_title}}</p>

    </header>
    <section class="scrollable wrapper">

        <div class="row">

            <div class="col-lg-12">
                <section class="panel panel-default">
                    <div class="panel-body">
                        <form action="/admin/keyword/add" class="form-horizontal" method="post"  data-validate="parsley">


                                    <div class="form-group">
                                        <label class="col-sm-2 control-label"><i class="fa fa-asterisk text-danger"></i> 话题标题</label>
                                        <div class="col-sm-10">
                                            <div class="row">
                                                <div class="col-md-3"><input name="keyname" type="text" class="form-control" data-required="true"></div>
                                                <div class="col-md-12 hide">
                                                    <span class="help-block m-b-none text-muted"><i class="fa fa-info-circle text-info"></i> 名称不能为空.</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="line line-dashed b-b line-lg pull-in"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">话题描述</label>
                                        <div class="col-sm-10">
                                            <div class="row">
                                                <div class="col-md-10"><textarea name="description" class="form-control"></textarea></div>
                                                <div class="col-md-12 hide">
                                                    <span class="help-block m-b-none text-muted"><i class="fa fa-info-circle text-info"></i> 非必填，填写后，此名称会替换url中的栏目id,英文字母.不能重复。</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="line line-dashed b-b line-lg pull-in"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">根话题</label>
                                        <div class="col-sm-10">
                                            <div class="row">
                                                <div class="col-md-10">
                                                    <label class="radio-inline i-checks">
                                                        <input type="radio"  value="1" name="is_parent"  onclick="$('.pid').hide()" ><i></i> 是
                                                    </label>
                                                    <label class="radio-inline i-checks">
                                                        <input type="radio"  value="0" name="is_parent"  onclick="$('.pid').show()"  checked><i></i>否
                                                    </label>
                                                </div>
                                                <div class="col-md-12 hide">
                                                    <span class="help-block m-b-none text-muted"><i class="fa fa-info-circle text-info"></i>  是否允许发布内容</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="line line-dashed b-b line-lg pull-in"></div>
                            <div class="form-group pid">
                                <label class="col-sm-2 control-label">选择根话题</label>
                                <div class="col-sm-10">
                                    <div class="row">
                                        <div class="col-md-3">
                                            <select class="form-control" name="pid" id="pid">
                                                <option value="0" selected="selected">---</option>
                                                {%for val in parent%}
                                                <option value="{{val.id}}" >{{val.keyname}}</option>
                                                {%endfor%}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="line line-dashed b-b line-lg pull-in pid"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">缩略图</label>
                                        <div class="col-sm-10">
                                            <div class="row">
                                                <div class="col-sm-10">
                                                    {{HOOKS@adminUpPic.pic|safe}}
                                                </div>
                                                <div class="col-md-12 hide">
                                                    <span class="help-block m-b-none text-muted"><i class="fa fa-info-circle text-info"></i> 图片上传</span>
                                                </div>
                                            </div>


                                        </div>
                                    </div>


                            <div class="form-group form-submit">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button type="submit" target-form="form-horizontal" class="btn btn-primary ajax-post">保存</button>
                                    <button type="submit" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返回</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </section>

            </div>

        </div>
    </section>
</section>

{% endblock %}

{% block script %}
<!-- slider -->
<!--<script src="/static/js/slider/bootstrap-slider.js"></script>-->
<!-- file input -->
<script src="/static/admin/js/chosen/chosen.jquery.min.js"></script>
<script src="/static/admin/js/file-input/bootstrap-filestyle.min.js"></script>
<script src="/static/admin/js/parsley/parsley.min.js"></script>
<script src="/static/admin/js/parsley/parsley.extend.js"></script>
<script type="text/javascript">
    $(function(){


    })
</script>
{% endblock %}